<template>
  <div class="content-page">
    首页
    <button @click="alert">弹窗</button>
  </div>
</template>

<script>
export default {
  name: "Home",
  data() {
    return {};
  },
  // 只有设置 keep-alive 为 true，才会执行 activated 函数
  activated() {
    // 跳转页面 返回时固定跳转到记录的滚动条位置
    window.pathScrollTop = window.pathScrollTop || {};
    let scrollTop = window.pathScrollTop[this.$route.fullPath] || 0;
    window.scrollTo(0, scrollTop);
    window.pathScrollTop[this.$route.fullPath] = 0;
  },
  methods: {
    alert() {
      this.Popups.Alert.show();
    },
  },
};
</script>

<style lang="scss" scoped>
.content-page {
  font-size: 0.42rem;
}
</style>
